home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / DATABASE.DIR / 00085_Script_CLICK TOPIC TEXT < prev    next >
Text File  |  1996-03-28  |  1KB  |  34 lines

  1. -- --------------------------------------------------------
  2. -- Handler doClickTopicText is called when the user clicks
  3. -- the text of a topic. It checks if the user clicked a
  4. -- hypermedia link or is dragging to copy a selection of 
  5. -- the text.
  6.  
  7. on doClickTopicText
  8.   global textSprite, currentTextCast, hypertextWords
  9.   global pictureButton, textButton
  10.   
  11.   -- (1) check that the picture button is not activated
  12.   -- because you don't want them to be able to click
  13.   -- the text sprite that appears behind the picture sprite
  14.   -- (2) check that the and artcle appears (ie the text
  15.   -- button is activated)
  16.   -- (3) check that the user did not double click on a link.
  17.   -- (if they did, and we weren't checking, the link might
  18.   -- appear all hilighted).
  19.   if not(isActivated(pictureButton)) and isActivated(textButton) and not(the doubleClick) then
  20.     set currentTextCast = the castNum of sprite textSprite 
  21.     
  22.     set wordNumber = the mouseWord 
  23.     set clickedword = word wordNumber of field currentTextCast 
  24.     
  25.     set linkType = getHyperLinkType(wordNumber)
  26.     
  27.     if (linkType <> -1) then
  28.       set the editableText of sprite textSprite = FALSE
  29.       processHyperLink(wordNumber, linkType)
  30.     else
  31.       --      set the editableText of sprite textSprite = TRUE
  32.     end if
  33.   end if
  34. end